package net.lzzy.practices.web.models;

import net.lzzy.practices.entities.Chapter;

import java.util.Date;
import java.util.UUID;

/****
 * @author zly on 2022/5/30
 * Description:
 */
public class VmChapter {
    private  final UUID id;
    private  final String name;
    private  final  String desc;
    private  final  boolean open;
    private  final  Date createTime;
    private  final Date updateTime;
    private  final  int countQuestion;
    private  final  UUID courseId;

    public   VmChapter(Chapter chapter){
        id=chapter.getId();
        name=chapter.getName();
        desc=chapter.getDescription();
        open = chapter.isOpen();
        createTime =  chapter.getCreateTime();
        updateTime=chapter.getUpdateTime();
        countQuestion=chapter.getQuestions().size();
        courseId=chapter.getCourse().getId();
    }
}
